{% extends "base.html" %}

{% block title %}{% endblock %}

{% block head %}
<link href="/medias/css/group.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript">
$(function() {
	if("{{alert}}"!="")
	{
		$("#submit").focus();
	}
});

</script>
{% endblock %}

{% block left_content %}
<div id="topic_title">{{topic.title}}</div>
<div id="topic_content">
   <img class="corner"  alt="topic.user.username" src="/medias/{{topic.user_image}}"/>
   <div class="bar"><span>{{topic.last_update}}</span><span><a href="">{{topic.user.username}}</a></span></div>
   <div class="content">{{topic.content|escape|linebreaks }}</div>	
   {% for reply in replies %}	
	<div class="replies">
	   <img class="corner" alt="{{reply.username}}" src="/medias/{{reply.user_image}}"/>
	   <div class="bar"><span>{{reply.last_update|date:"Y-m-d H:i" }}</span>&nbsp;&nbsp;<span><a href="#">{{reply.username}}</a></span></div>
	   <div class="content">{{reply.content|escape|linebreaks}}</div>		
	</div>   
	{% endfor %}
</div>

<div id="topic_comment_input">
<h3><span class="sLeft">我来回复</span><span class="sRight"></span></h3>
<form  style="text-align:left;" action="/topic/reply/add/"  method="post" >{% csrf_token %}
    <p><textarea id="contenr_f" name="content" class="corner"></textarea></p>
	<input id="topid_f" type="hidden" name="topid" value="{{topic.id}}"/>
	<p><input id="submit" class="button" type="submit" value="提交"><span style="margin-left:10px;color:#0080ff;" id="erorr">{{alert|escape}}</span></p>
</form>
</div>
{% endblock %}

{% block right_content %}
<h3><span class="sLeft"><<<a href="/group/{{group.id}}/">返回{{group.name}}圈子</span></a></h3>
{% endblock %}